<?php
echo "
</head>
<body id=\"styles\">
<div id=\"container\">
<div id=\"fb-root\"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({
      appId      : 'YOUR_APP_ID', // App ID
      channelURL : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File
      status     : true, // check login status
      cookie     : true, // enable cookies to allow the server to access the session
      oauth      : true, // enable OAuth 2.0
      xfbml      : true  // parse XFBML
    });

    // Additional initialization code here
  };

  // Load the SDK Asynchronously
  (function(d){
     var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
     js = d.createElement('script'); js.id = id; js.async = true;
     js.src = \"//connect.facebook.net/en_US/all.js\";
     d.getElementsByTagName('head')[0].appendChild(js);
   }(document));
</script>"
;
$menu_array=array("Bemutatkoz&#225;s","Gal&#233;ria","F&#243;rum","Jelentkez&#336;knek az egyetemre", "Jelentkez&#336;knek a t&#225;borra","H&#246;k&#246;k"); 
// menu 
echo "<div id=\"logo\" ></div>
	  <div id=\"links\" class=\"borderdiv\">
	  <ul id=\"menu\">";
	  for($i=0;$i<6;$i++){
			echo "<li><a href=\"#\">$menu_array[$i]</a>";
			$result=mysql_query("SELECT * FROM menu WHERE melyikmenu='$i'");
			if (mysql_num_rows($result)>0)
			{
				echo "<ul>";
				while ($data=mysql_fetch_array($result))
				{
					echo "
							<li><a href=\"$data[menu_link]\">$data[menu_nev]</a></li>
							";
				}
				echo "</ul>";
			}
			echo "</li>";
			
		}
	echo "</ul>
	";
// menu over
// login and personal stuff div
echo "</div>
	<div id=\"personal\" class=\"borderdiv\">";
	if (isset($_SESSION['id_user'])){
		echo "<br />Welcome <label>$data1[username]</label> <br /><br /> \n
			  <a class=\"menu\" href=\"personal.php\" />&nbsp;Personal data&nbsp;</a> \n
			  <a class=\"menu\" href=\"inbox.php\" />&nbsp;Inbox&nbsp;</a><br /> \n";
		$num_msg=mysql_num_rows(mysql_query("SELECT * FROM priv_msg WHERE id_receiver='$_SESSION[id_user]' AND status='0'"));
		if ($num_msg>0)
			echo "<br /><label>You have $num_msg unread messages!<label><br />";
		echo "<br /><a class=\"menu\" href=\"logout.php\" >&nbsp;&nbsp;Log out&nbsp;&nbsp;</a> ";
		}
	else{
		if (isset($_GET['error']))
			switch ($_GET['error']){
				case "pass":
					echo "<label class=\"redlabel\">You have entered the wrong password!</label>";
					break;
				case "na":
					echo "<label class=\"redlabel\">Your account has not been activates yet !</label>";
					break;
				case "ba":
					echo "<label class=\"redlabel\">Your account has been banned !</label>";
					break;
				}
		echo "<form action=\"login.php\" method=\"post\">
		      <table>
			  <tr><td><label>Username</label></td><td><input type=\"text\" name=\"username\" /></td></tr>
			  <tr><td><label>Password</label></td><td><input type=\"password\" name=\"password\" /></td></tr>
			  <tr><td><input type=\"submit\" value=\"Log in\" />
			  </table>
			  </form>
			  <a href=\"register.php\" >If you don't have an account yet,click here to register one ! </a>";
		}
// login and personal stuff div over
// div for shout messages
echo "</div>
<div id=\"content\">
THIS IS THE CONTENT AWWWW YEAH!
</div>
<div id=\"shoutboxdiv\">
	  <label>Shoutbox</label> <br /> \n";
if (isset($_SESSION['id_user'])){
	echo "<form action=\"shout_submit.php\" method=\"post\">
		  <textarea cols=\"33\" name=\"shout_msg\"></textarea><br />
		  <input type=\"submit\" name=\"shout_submit\" value=\"Send\" />
		  </form>";
}
echo "</div>";
// div for shout messages over
// div for recent topics
echo "<div id=\"rec_topicsdiv\">
	  <label>Recent topics</label> <br /> \n
	  </div>";
echo	" <div id=\"fblike\"class=\"fb-like\" data-href=\"www.bela.hu\" data-send=\"true\" data-width=\"450\" data-show-faces=\"true\" data-font=\"arial\"></div>";
// div for recent topics over
?>